package chapter4;
import java.util.Scanner;
/****************************************************************
 * Author：icynlau
 * Description:  电话键盘
 * 			这里注意字符的大小写变换方法是静态方法，不需要绑定实例
 * Date:2021/4/2
 * ***************************************************************
 */
public class exc4_15 {
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		System.out.print("Enter a letter :");
		//直接统一变成大写字母
		char letter=input.next().charAt(0);
		char upLetter=Character.toUpperCase(letter);
		if(upLetter>='A'&&upLetter<='C') {
			System.out.println("The corresponding number is 2");
		}else if(upLetter>='D'&&upLetter<='F') {
			System.out.println("The corresponding number is 3");
		}else if(upLetter>='G'&&upLetter<='I') {
			System.out.println("The corresponding number is 4");
		}else if(upLetter>='J'&&upLetter<='L') {
			System.out.println("The corresponding number is 5");
		}else if(upLetter>='M'&&upLetter<='O') {
			System.out.println("The corresponding number is 6");
		}else if(upLetter>='P'&&upLetter<='S') {
			System.out.println("The corresponding number is 7");
		}else if(upLetter>='T'&&upLetter<='V') {
			System.out.println("The corresponding number is 8");
		}else if(upLetter>='W'&&upLetter<='Z') {
			System.out.println("The corresponding number is 9");
		}else {
			System.out.println(letter +" is an invalid input.");
		}
		
	}
}
